GBML manual / Events

beyond_room

Runs every frame this instance’s position has left the current room’s own bounds entirely.

Syntax

beyond_room: fires every frame this instance is outside the room entirely

Description

Runs every frame this instance's position has left the current room's own bounds entirely - not just touching the edge, actually past it on some axis. A level check, not an edge trigger: it keeps running every frame the condition holds, not just once on the frame it first became true.

The usual uses are opposite ends of the same idea: destroy something that was never meant to re-enter (a bolt that missed), or pull something important back inside (a boss that must stay in its arena).

Example

instance_destroy(self);

Removes this instance the moment it has fully left the room - typical for a projectile that should not linger once it can no longer hit anything.

See also: hit_room_edgebeyond_viewroom_widthroom_heightEvents